[Fwd: Re: unable to connect to datadase....]

This is a multi-part message in MIME format.

--Boundary_(ID_uYQMXUiHijE1TFMb+quZVw)
Content-type: multipart/alternative;
boundary="Boundary_(ID_msvGG6FizYYv5qsoQJVgnw)"

--Boundary_(ID_msvGG6FizYYv5qsoQJVgnw)
Content-type: text/plain; charset=ISO-8859-1; format=flowed
Content-transfer-encoding: 7BIT

Make sure that the postmaster is running with the -i flag allowing
tcp\ip connections

I suggest you use pg_last_error() and pg_last_notice() to see detailed
errors if any.

Cheers
Noel

manashi chakraborty wrote:
>
>
> hi...
> I am doin my project in PHP with PostgreSQL as backend...
> Both r very new to me....
> My OS is LINUX
> I am trying to connect to the database bt its not getin connected...
> By using
> "su postgres" command
> i hav created user "root" and database "sample"
> By using
> "psql -U root sample" command
> i hav created table "login" and inserted 3 data's...
> Now through code using PHP i am trying to insert the data but
> connection is not getin established..
> the code to connect to the datadase is :-
>
> <?php
> require_once "DB.php";
> $uname=$_POST['uname'];
> $pass=$_POST['pass'];
>
> $username="root";
> $password="";
> $hostname="localhost";
> $dbname="sample";
>
> $db=new DB;
> $dsource=$db->factory("pgsql");
>
> $dcon=pg_connect("dbname=sample user=manashi");
>
> $sql="insert into login values('$uname','$pass')";
>
> $rs=$dsource->pg_query($sql);
> ?>
>
> is there anythin wrong with tthe code or sum other problem
> waiting for the reply...
>
>
> <http://adworks.rediff.com/cgi-bin/AdWorks/sigclick.cgi/www.rediff.com/signature-home.htm/1507191490 [at] Middle5?PARTNER=3>



--Boundary_(ID_msvGG6FizYYv5qsoQJVgnw)
Content-type: text/html; charset=ISO-8859-1
Content-transfer-encoding: 7BIT

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
Make sure that the postmaster is running with the -i flag allowing
tcp\ip connections<br>
<br>
I suggest you use pg_last_error() and pg_last_notice() to see
detailed errors if any.<br>
<br>
Cheers<br>
Noel<br>
<br>
manashi chakraborty wrote:
<blockquote cite="mid20060321062429.7753.qmail [at] webmail35.rediffmail.com"
type="cite">
<p>  <br>
hi...<br>
    I am doin my project in PHP with PostgreSQL as backend...<br>
        Both r very new to me....<br>
My OS is LINUX  <br>
I am trying to connect to the database bt its not getin connected...<br>
  By using<br>
    "su postgres" command<br>
  i hav created user "root" and database "sample"<br>
    By using<br>
    "psql -U root sample" command<br>
      i hav created table "login" and inserted 3 data's...<br>
  Now through code using PHP i am trying to insert the data but 
connection is not getin established..  <br>
  the code to connect to the datadase is :-<br>
  <br>
<?php<br>
  require_once "DB.php";<br>
  $uname=$_POST['uname'];<br>
  $pass=$_POST['pass'];<br>
<br>
$username="root";<br>
$password="";<br>
$hostname="localhost";<br>
$dbname="sample";<br>
<br>
$db=new DB;<br>
$dsource=$db->factory("pgsql");<br>
<br>
$dcon=pg_connect("dbname=sample user=manashi");<br>
<br>
$sql="insert into login values('$uname','$pass')";<br>
<br>
$rs=$dsource->pg_query($sql);<br>
?><br>
<br>
  is there anythin wrong with tthe code or sum other problem<br>
    waiting for the reply... </p>
</blockquote>
<blockquote cite="mid20060321062429.7753.qmail [at] webmail35.rediffmail.com"
type="cite"><a
href="http://adworks.rediff.com/cgi-bin/AdWorks/sigclick.cgi /www.rediff.com/signature-home.htm/1507191490 [at] Middle5?PARTNE R=3"><br>
</a></blockquote>
<br>
<br>
</body>
</html>

--Boundary_(ID_msvGG6FizYYv5qsoQJVgnw)--

--Boundary_(ID_uYQMXUiHijE1TFMb+quZVw)
Content-type: text/x-vcard; charset=utf-8; name=noel.faux.vcf
Content-transfer-encoding: 7BIT
Content-disposition: attachment; filename=noel.faux.vcf

begin:vcard
fn:Noel Faux
n:Faux;Noel
org:Monash University;Biochemistry and Molecular Biology
adr:;;;Clayton;Vic;3800;Australia
email;internet:noel.faux [at] med.monash.edu.au
tel;work:+61 03 9905 1418
url:http://vbc.med.monash.edu.au/~fauxn
version:2.1
end:vcard


--Boundary_(ID_uYQMXUiHijE1TFMb+quZVw)
Content-Type: text/plain
Content-Disposition: inline
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable


---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

--Boundary_(ID_uYQMXUiHijE1TFMb+quZVw)--
Noel Faux [ Mi, 22 März 2006 00:38 ] [ ID #1239083 ]
Datenbanken » gmane.comp.db.postgresql.php » [Fwd: Re: unable to connect to datadase....]

Vorheriges Thema: php error reporting problem
Nächstes Thema: unable to connect to datadase....